import { defineStore } from 'pinia';
import { Local } from '@/assets/utils/storage';

export const storeKey = 'serviceId';

export const useServiceStore = defineStore('serviceStore', {
  state: () => ({
    serviceId: Local.get(storeKey) as string || 'backend-bsms'
  }),
  actions: {
    async setServiceId(serviceId: string) {
      this.serviceId = serviceId;
      Local.set(storeKey, this.serviceId)
    }
  }
});